package com.ruoyi.finance.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.finance.mapper.TFreightBillInfoMapper;
import com.ruoyi.finance.domain.TFreightBillInfo;
import com.ruoyi.finance.service.ITFreightBillInfoService;

/**
 * 运费账单Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-05-16
 */
@Service
public class TFreightBillInfoServiceImpl implements ITFreightBillInfoService 
{
    @Autowired
    private TFreightBillInfoMapper tFreightBillInfoMapper;

    /**
     * 查询运费账单
     * 
     * @param freightBillId 运费账单主键
     * @return 运费账单
     */
    @Override
    public TFreightBillInfo selectTFreightBillInfoByFreightBillId(Long freightBillId)
    {
        return tFreightBillInfoMapper.selectTFreightBillInfoByFreightBillId(freightBillId);
    }

    /**
     * 查询运费账单列表
     * 
     * @param tFreightBillInfo 运费账单
     * @return 运费账单
     */
    @Override
    public List<TFreightBillInfo> selectTFreightBillInfoList(TFreightBillInfo tFreightBillInfo)
    {
        return tFreightBillInfoMapper.selectTFreightBillInfoList(tFreightBillInfo);
    }

    /**
     * 新增运费账单
     * 
     * @param tFreightBillInfo 运费账单
     * @return 结果
     */
    @Override
    public int insertTFreightBillInfo(TFreightBillInfo tFreightBillInfo)
    {
        tFreightBillInfo.setCreateTime(DateUtils.getNowDate());
        return tFreightBillInfoMapper.insertTFreightBillInfo(tFreightBillInfo);
    }

    /**
     * 修改运费账单
     * 
     * @param tFreightBillInfo 运费账单
     * @return 结果
     */
    @Override
    public int updateTFreightBillInfo(TFreightBillInfo tFreightBillInfo)
    {
        tFreightBillInfo.setUpdateTime(DateUtils.getNowDate());
        return tFreightBillInfoMapper.updateTFreightBillInfo(tFreightBillInfo);
    }

    /**
     * 批量删除运费账单
     * 
     * @param freightBillIds 需要删除的运费账单主键
     * @return 结果
     */
    @Override
    public int deleteTFreightBillInfoByFreightBillIds(Long[] freightBillIds)
    {
        return tFreightBillInfoMapper.deleteTFreightBillInfoByFreightBillIds(freightBillIds);
    }

    /**
     * 删除运费账单信息
     * 
     * @param freightBillId 运费账单主键
     * @return 结果
     */
    @Override
    public int deleteTFreightBillInfoByFreightBillId(Long freightBillId)
    {
        return tFreightBillInfoMapper.deleteTFreightBillInfoByFreightBillId(freightBillId);
    }

    /**
     * 查询运费账单ID
     *
     * @param freightBillNumber 工资单号
     * @return 结果
     */
    @Override
    public Long selectFreightBillIdByFreightBillNumber(String freightBillNumber)
    {
        return tFreightBillInfoMapper.selectFreightBillIdByFreightBillNumber(freightBillNumber);
    }


}
